package com.spring.format.code.generation.mybatis.vo;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.spring.format.code.generation.constants.FileNameEnumType;
import com.spring.format.code.generation.mybatis.po.TablePO;
import com.spring.format.code.generation.util.NameUtil;

/**
 * 生成文件类
 * 
 * @author Administrator
 *
 */
public class CreateFileVO {
	/**
	 * 数据库表信息
	 */
	private TablePO tablePO;
	/**
	 * java 字段信息
	 */
	private List<JavaAttributeVO> attrVOList;
	/**
	 * 文件内容
	 */
	private String content;
	/**
	 * 文件路径
	 */
	private String filePath;
	/**
	 * 文件名称
	 */
	private String fileName;

//	private String poName;
//
//	private String voName;
//
//	private String formName;
//
//	private String daoName;
//
//	private String serviceName;
//
//	private String serviceImplName;
//
//	private String bizName;
//
//	private String bizImplName;
//
//	private String webServiceName;
//
//	private String webServiceImplName;
//
//	private String controllerName;
//
//	private String actionName;

	private String mapperName;

	public CreateFileVO() {
		super();
	}

	public String getMapperName() {
		if(StringUtils.isBlank(mapperName)&&null!=this.tablePO) {
			mapperName = NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.MAPPER_MAP_NAME);
		}
		return mapperName;
	}

	public String getPoName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.PO_NAME);
	}

	public String getVoName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.VO_NAME);
	}

	public String getFormName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.FORM_NAME);
	}

	public String getDaoName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.DAO_API_NAME);
	}

	public String getServiceName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.SERVICE_API_NAME);
	}

	public String getServiceImplName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.SERVICE_NAME);
	}

	public String getBizName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.BIZ_API_NAME);
	}

	public String getBizImplName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.BIZ_NAME);
	}

	public String getWebServiceName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.WEB_SERVICE_API_NAME);
	}

	public String getWebServiceImplName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.WEB_SERVICE_NAME);
	}

	public String getControllerName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.CONTROLLER_NAME);
	}

	public String getActionName() {
		return NameUtil.createFileName(this.tablePO.getTable_name(), FileNameEnumType.ACTION_NAME);
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public TablePO getTablePO() {
		return tablePO;
	}

	public void setTablePO(TablePO tablePO) {
		this.tablePO = tablePO;
	}

	public List<JavaAttributeVO> getAttrVOList() {
		return attrVOList;
	}

	public void setAttrVOList(List<JavaAttributeVO> attrVOList) {
		this.attrVOList = attrVOList;
	}

}
